const babel=require("@babel/core");
let sourceCode=`[1,2,3].map(n=>n*n)`;


//使用API方式选择插件或者预设
let opt={
    presets:[],
    Plugins:["@babel/plugin-transform-arrow-functions"]
};
babel.transform(sourceCode,opt,(err,result)=>{
    console.log("结果是"+result);
});


// const app = () => {
//     const greeting = 'World' ?? 'Tony'
//     return <div>
//       {`Hello,${greeting}`}
//     </div>
//   }
var res = [[0, 1, 2].reduce((prev, current) => prev + current, 0)];
console.log(...res);
export {res}